#!/bin/bash

RFBPORT=5900
WHD=1024x768x16

exec 0<&-
exec 1>/dev/null
exec 2>/dev/null

if [ -z "$DISPLAY" ]; then
	/usr/bin/xvfb-run -a -s "-screen 0 $WHD" $0 &
else
	/usr/bin/xfce4-session &
	/usr/bin/x11vnc -display $DISPLAY -repeat -loop -rfbport $RFBPORT
fi
